package com.lagou.springbootwork.mapper;

import com.lagou.springbootwork.entity.Article;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ClassName
 * @Deseription TODO
 * @Author fx
 * @Date 2021/1/7 0007 21:44
 * @Version 1.0
 **/
@Mapper
public interface ArticleMpper {

    /**
     * @Author fx
     * @Description 查询所有文章信息
     * @ClassName ArticleMpper
     * @Date 21:50 2021/1/7 0007
     * @Param
     * @return
     **/
    @Select("select * from t_article")
    public List<Article> getAll() throws Exception;


    /**
     * @Author fx
     * @Description 根据Id获取文章信息
     * @ClassName ArticleMpper
     * @Date 15:51 2021/1/9 0009
     * @Param
     * @return
     **/
    @Select("select * from t_article where id = #{id}")
    public Article getById(Integer id) throws Exception;
}
